



#ifndef _DIALOGS_H_
#define _DIALOGS_H_






#include "scrollingdialog.h"



enum myFindReplaceFlags {

    myFR_DOWN = 1,
    myFR_WHOLEWORD = 2,
    myFR_MATCHCASE = 4,
    myFR_FINDREGEX = 8,
    myFR_SUBFOLDER = 16,
};


enum myFindReplaceDialogStyles {

    myFR_FINDINFILES = 1,
    myFR_REPLACEDIALOG = 2,
    myFR_NOUPDOWN      = 4,
    myFR_NOMATCHCASE   = 8,
    myFR_NOWHOLEWORD   = 16,
    myFR_NOFINDREGEX   = 32,
};



class myFindReplaceDlg: public wxScrollingDialog
{
public:


    myFindReplaceDlg (wxWindow *parent,
                      const wxString &findstr = wxEmptyString,
                      const wxString &replacestr = wxEmptyString,
                      wxUint32 flags = 0,
                      long style = wxDEFAULT_DIALOG_STYLE);


    ~myFindReplaceDlg ();


    void OnCancel (wxCommandEvent& event);
    void OnOkay (wxCommandEvent& event);
    void OnHelp (wxCommandEvent &event);
    void OnReplace (wxCommandEvent& event);
    void OnReplaceAll (wxCommandEvent& event);


    wxString GetFindDirectory ();
    void SetFindDirectory (const wxString &str);
    wxString GetFindFilespec ();
    void SetFindFilespec (const wxString &str);
    wxString GetFindString ();
    void SetFindString (const wxString &str);
    wxString GetReplaceString ();
    void SetReplaceString (const wxString &str);
    int GetFlags ();
    void SetFlags (int flags);


    int ShowModal (long style = wxDEFAULT_DIALOG_STYLE);

private:
    long m_style;


    wxComboBox *m_finddir;
    wxTextCtrl *m_findspec;
    wxComboBox *m_findstr;
    wxComboBox *m_replacestr;
    wxCheckBox *m_matchcase;
    wxCheckBox *m_wholeword;
    wxCheckBox *m_findregex;
    wxCheckBox *m_subfolder;
    wxRadioBox *m_direction;


    wxButton *m_cancelButton;
    wxButton *m_findButton;
    wxButton *m_replaceButton;
    wxButton *m_replaceAllButton;


    wxBoxSizer *m_totalpane;
    wxBoxSizer *m_findpane;
    wxBoxSizer *m_fdirsizer;
    wxBoxSizer *m_specsizer;
    wxBoxSizer *m_replsizer;
    wxBoxSizer *m_buttonpane;
    wxBoxSizer *m_optionpane;
    wxBoxSizer *m_optionsizer;
    wxBoxSizer *m_dirssizer;

    void LoadDirHistory ();
    void StoreDirHistory ();
    void UpdateDirHistory (wxString item = wxEmptyString);
    void LoadFindHistory ();
    void StoreFindHistory ();
    void UpdateFindHistory (wxString item = wxEmptyString);
    void LoadReplaceHistory ();
    void StoreReplaceHistory ();
    void UpdateReplaceHistory (wxString item = wxEmptyString);

    DECLARE_EVENT_TABLE()
};


class myGotoDlg: public wxScrollingDialog
{
public:


    myGotoDlg (wxWindow *parent,
               long style = wxDEFAULT_DIALOG_STYLE);


    void OnHelp (wxCommandEvent &event);


    int GetPosition ();
    void SetPosition (int position);


    int ShowModal (long style = wxDEFAULT_DIALOG_STYLE);

private:


    wxTextCtrl *m_position;


    wxButton *m_cancelButton;
    wxButton *m_gotoButton;

    DECLARE_EVENT_TABLE()
};

#endif
